<?php /* Smarty version 2.6.16, created on 2012-02-23 19:17:29
         compiled from login.tpl */ ?>
<?php echo '
<script type="text/javascript">
function chk_login()
{
	var email = $(\'#login-email\').val();
	var password = $(\'#login-password\').val();
	
	if(email == ""){
		$(\'#FormErrorMsg\').html("Please enter your email");
		$(\'#login-email\').css("border", "1px solid #FF0000");
		$(\'#login-email\').focus();	
		return false;	
	}
	else{
		$(\'#FormErrorMsg\').html("");
		$(\'#login-email\').css("border", "1px solid #000");		
	}
	if(password == "")
	{
		$(\'#FormErrorMsg\').html("Please enter your password");
		$(\'#login-password\').css("border", "1px solid #FF0000");
		$(\'#login-password\').focus();		
		return false;
	}
	else{
		$(\'#FormErrorMsg\').html("");
		$(\'#login-password\').css("border", "1px solid #000");	
	}
	
	Dologin(email,password);
	
	return false;
}

function Dologin(email,password)
{
	var j = jQuery.noConflict(); 
	var retval1 = 1;
	var retval2 = 1;
	
	var frmID=\'#loginForm\';
	
			var params ={

				\'module\': \'contact\',

				\'action\': \'sendContactData\'

			};

			var paramsObj = j(frmID).serializeArray();

			
			/*j.each(paramsObj, function(i, field){

				params[field.name] = field.value;

			});*/
			params[\'email\'] = email;
			params[\'password\'] = password;

     
		if(retval1 && retval2)
		{
			
			j.ajax({

				type: "POST",

				url: \'processlogin.php\',

				data: params,

				dataType: \'json\',
				
				success: function(data){					
					
					if (data.flag == 1)
					{
						$.post("forum/ucp.php?mode=login&main_site=true",{"username":email,"password":password,"redirect":"","login":"Log in"}, function(data){
							window.location.href=document.getElementById(\'url\').value;
						});
					}
					else
					{
						j(\'#FormErrorMsg\').html(\'Authentication failed\');
					}

				}

		});
		}
}
</script>
'; ?>

<div class="right-panel">
      <div class="replays-title"><h1 title="Replays"><span>Login</span></h1></div>
      <div class="clear"></div>
      
      <div class="register">
	  <div id='FormErrorMsg' style="color:red; padding-bottom:10px; padding-left:140px;"><?php if ($this->_tpl_vars['ermsg'] != ''): ?> <?php echo $this->_tpl_vars['ermsg'];  endif; ?> </div>
      <form name="loginForm" id="loginForm" enctype="multipart/form-data" method='post'>
	  <input type="hidden" name="user_type" value="<?php echo $this->_tpl_vars['user_type']; ?>
">
         <fieldset>
            <label>Email :</label>
            <input name="login-email" type="text" id="login-email" class="con-req" value="" />
			<p class="clear"></p>			
            <label>Password :</label>
            <input name="login-password" type="password" id="login-password" class="con-req" value="" />
            <p class="clear"></p>	
            <label>&nbsp;</label>
			<input type="hidden" name="url" id="url" value="<?php echo $this->_tpl_vars['url']; ?>
" />
            <input name="submit" class="submit" value="Submit" type="submit" onclick='return chk_login()' />
            <input name="" class="cancel" value="Reset" type="reset" />
         </fieldset>
      </form>
      </div>      
     
      <div class="clear"></div>
   </div>